document.querySelectorAll('nav ul li a').forEach(link => {
    link.addEventListener('mouseover', () => {
        console.log(`Navigating to ${link.getAttribute('href')}`);
    });
});
function addBubble(x, y) {
    const bubble = document.createElement('div');
    bubble.classList.add('bubble');
    bubble.style.left = x + 'px';
    bubble.style.top = (y - 90) + 'px';
    document.querySelector('.bubbles').appendChild(bubble);

    // 动画完成后移除元素
    setTimeout(() => document.querySelector('.bubbles').removeChild(bubble), 200);
}

// 监听鼠标移动事件并添加气泡   
document.addEventListener('mousemove', e => {
    addBubble(e.clientX, e.clientY);
});

const pointer = document.querySelector('.pointer');

const onPointerMove = (e) => {
    const mouseY = e.clientY;
    const mouseX = e.clientX;
    pointer.style.transform = `translate3d(${mouseX - 10}px, ${mouseY - 100}px, 0)`;
}


window.addEventListener("mousemove", onPointerMove);
// window.addEventListener("mousedown", onMouseClick);